The semiconductor integrated circuit (IC) industry has experienced rapid growth. Technological advances in IC manufacturing and design have produced generations of ICs where each generation has smaller and more complex circuits than the previous generation. Such advances have increased the complexity and challenges of fabricating the ICs. In IC fabrication or processing, a hard mask is used to protect against loss of unintended materials on a substrate during an etching process. To pattern gate structures including a polysilicon layer, a hard mask is deposited over the polysilicon layer to prevent against loss of the polysilicon layer during the etching process. The hard mask is removed after processing (e.g., processing that may include, for example, a patterning etch, an implantation, wet cleaning, etc.) to allow the polysilicon layer to either become polycide (for a polysilicon gate) or to be replaced by another conductive metal (for a replacement gate).